import localStorage from './localStorage';

const TokenKey = 'token'

export function getToken() {
  const { status, value } = localStorage.get(TokenKey)
  if (status === 0) {
    return value;
  }
  return null
}

export function setToken(token) {
  localStorage.set(TokenKey, token, new Date().getTime() + 1000 * 60 * 60 * 12)
}

export function removeToken() {
  localStorage.remove(TokenKey)
}
